Protein expression (MDAnderson RPPA)

The goal of this notebook is to introduce you to the Protein expression BigQuery table.

This table contains all available TCGA Level-3 protein expression data produced by MD Anderson's RPPA pipeline, as of July 2016. The most recent archives (eg mdanderson.org_COAD.MDA_RPPA_Core.Level_3.2.0.0) for each of the 32 tumor types was downloaded from the DCC, and data extracted from all files matching the pattern %_RPPA_Core.protein_expression%.txt. Each of these “protein expression” files has two columns: the Composite Element REF and the Protein Expression. In addition, each mage-tab archive contains an antibody_annotation file which is parsed in order to obtain the correct mapping between antibody name, protein name, and gene symbol. During the ETL process, portions of the protein name and the antibody name were extracted into additional columns in the table, including Phospho, antibodySource and validationStatus.

In order to work with BigQuery, you need to import the python bigquery module (gcp.bigquery) and you need to know the name(s) of the table(s) you are going to be working with:


In [1]:
import gcp.bigquery as bq
rppa_BQtable = bq.Table('isb-cgc:tcga_201607_beta.Protein_RPPA_data')

From now on, we will refer to this table using this variable ($rppa_BQtable), but we could just as well explicitly give the table name each time.

Let's start by taking a look at the table schema:


In [2]:
%bigquery schema --table $rppa_BQtable


Out[2]:

Let's count up the number of unique patients, samples and aliquots mentioned in this table. We will do this by defining a very simple parameterized query. (Note that when using a variable for the table name in the FROM clause, you should not also use the square brackets that you usually would if you were specifying the table name as a string.)


In [3]:
%%sql --module count_unique

DEFINE QUERY q1
SELECT COUNT (DISTINCT $f, 25000) AS n
FROM $t

In [4]:
fieldList = ['ParticipantBarcode', 'SampleBarcode', 'AliquotBarcode']
for aField in fieldList:
  field = rppa_BQtable.schema[aField]
  rdf = bq.Query(count_unique.q1,t=rppa_BQtable,f=field).results().to_dataframe()
  print " There are %6d unique values in the field %s. " % ( rdf.iloc[0]['n'], aField)


 There are   7845 unique values in the field ParticipantBarcode. 
 There are   7933 unique values in the field SampleBarcode. 
 There are   7943 unique values in the field AliquotBarcode. 
We can do the same thing to look at how many unique gene symbols and proteins exist in the table:

In [5]:
fieldList = ['Gene_Name', 'Protein_Name', 'Protein_Basename']
for aField in fieldList:
  field = rppa_BQtable.schema[aField]
  rdf = bq.Query(count_unique.q1,t=rppa_BQtable,f=field).results().to_dataframe()
  print " There are %6d unique values in the field %s. " % ( rdf.iloc[0]['n'], aField)


 There are    217 unique values in the field Gene_Name. 
 There are    259 unique values in the field Protein_Name. 
 There are    219 unique values in the field Protein_Basename. 

Based on the counts, we can see that there are several genes for which multiple proteins are assayed, and that overall this dataset is quite small compared to most of the other datasets. Let's look at which genes have multiple proteins assayed:


In [6]:
%%sql

SELECT
  Gene_Name,
  COUNT(*) AS n
FROM (
  SELECT
    Gene_Name,
    Protein_Name,
  FROM
    $rppa_BQtable
  GROUP BY
    Gene_Name,
    Protein_Name )
GROUP BY
  Gene_Name
HAVING
  ( n > 1 )
ORDER BY
  n DESC


Out[6]:
Gene_Namen
EIF4EBP14
PARP13
SRC3
EGFR3
AKT23
AKT33
AKT13
GSK3B3
CDKN1B3
RPS63
GSK3A3
CHEK13
MYH92
RAF12
PYGB2
FOXO32
PRKAA12
ERBB22
RB12
ESR12
ARAF2
YBX12
TSC22
ACACA2
RICTOR2

(rows: 42, time: 1.1s, 30MB processed, job: job_tbt23N58wYdiUQoFPqOqv4QpiWw)

Let's look further in the the EIF4EBP1 gene which has the most different proteins being measured:


In [7]:
%%sql

SELECT
  Gene_Name,
  Protein_Name,
  Phospho,
  antibodySource,
  validationStatus
FROM
  $rppa_BQtable
WHERE
  ( Gene_Name="EIF4EBP1" )
GROUP BY
  Gene_Name,
  Protein_Name,
  Phospho,
  antibodySource,
  validationStatus
ORDER BY
  Gene_Name,
  Protein_Name,
  Phospho,
  antibodySource,
  validationStatus


Out[7]:
Gene_NameProtein_NamePhosphoantibodySourcevalidationStatus
EIF4EBP14E-BP1 RV
EIF4EBP14E-BP1_pS65pS65RV
EIF4EBP14E-BP1_pT37_T46pT37_T46RV
EIF4EBP14E-BP1_pT70pT70RC
EIF4EBP14E-BP1_pT70pT70RV

(rows: 5, time: 1.1s, 45MB processed, job: job_SgenmfoKWUaoks4yU5uW3SxRf9s)

Some antibodies are non-specific and bind to protein products from multiple genes in a gene family. One example of this is the AKT1, AKT2, AKT3 gene family. This non-specificity is indicated in the antibody-annotation file by a list of gene symbols, but in this table, we duplicate the entries (as well as the data values) on multiple rows:


In [8]:
%%sql

SELECT
  Gene_Name,
  Protein_Name,
  Phospho,
  antibodySource,
  validationStatus
FROM
  $rppa_BQtable
WHERE
  ( Gene_Name CONTAINS "AKT" )
GROUP BY
  Gene_Name,
  Protein_Name,
  Phospho,
  antibodySource,
  validationStatus
ORDER BY
  Gene_Name,
  Protein_Name,
  Phospho,
  antibodySource,
  validationStatus


Out[8]:
Gene_NameProtein_NamePhosphoantibodySourcevalidationStatus
AKT1Akt RV
AKT1Akt_pS473pS473RV
AKT1Akt_pT308pT308RV
AKT1S1PRAS40_pT246pT246RV
AKT2Akt RV
AKT2Akt_pS473pS473RV
AKT2Akt_pT308pT308RV
AKT3Akt RV
AKT3Akt_pS473pS473RV
AKT3Akt_pT308pT308RV

(rows: 10, time: 1.5s, 45MB processed, job: job_U2oT67OWVVo4W9ta4ssOKLiXeCI)

In [9]:
%%sql

SELECT
  SampleBarcode,
  Study,
  Gene_Name,
  Protein_Name,
  Protein_Expression
FROM
  $rppa_BQtable
WHERE
  ( Protein_Name="Akt" )
ORDER BY
  SampleBarcode,
  Gene_Name
LIMIT
  9


Out[9]:
SampleBarcodeStudyGene_NameProtein_NameProtein_Expression
TCGA-02-0003-01AGBMAKT1Akt-0.0372666185
TCGA-02-0003-01AGBMAKT2Akt-0.0372666185
TCGA-02-0003-01AGBMAKT3Akt-0.0372666185
TCGA-02-0004-01AGBMAKT1Akt-1.14494074
TCGA-02-0004-01AGBMAKT2Akt-1.14494074
TCGA-02-0004-01AGBMAKT3Akt-1.14494074
TCGA-02-0011-01BGBMAKT1Akt-0.319130557
TCGA-02-0011-01BGBMAKT2Akt-0.319130557
TCGA-02-0011-01BGBMAKT3Akt-0.319130557

(rows: 9, time: 1.1s, 89MB processed, job: job_UqRCkgBuVxiDDh0kWKoFgfHvcag)

In [ ]: